#include <iostream>
#include <stdlib.h>
#include <vector>

using namespace std;

#include "Token.h"
#include "ExprNode.h"
#include "AddNode.h"
#include "IntNode.h"
#include "VectorNode.h"
#include "StatNode.h"
#include "VarNode.h"
#include "AssignNode.h"
#include "PrintNode.h"
#include "StatListNode.h"
#include "MultNode.h"

IntNode *I(int i) {
    return new IntNode(new Token(Token::INT, to_string(i)));
}

int main(int argc, char *argv[])
{
    vector<StatNode*> stats;
    AddNode *a = new AddNode(I(3), new Token(Token::PLUS), I(4));
    VarNode *x = new VarNode(new Token(Token::ID, "x"));
    AssignNode *assign = new AssignNode(x, new Token(Token::ASSIGN, "="), a);
    stats.push_back(assign);
    Token *mult = new Token(Token::MULT, "*");
    vector<ExprNode*> elements;
    elements.push_back(I(2));
    elements.push_back(I(3));
    elements.push_back(I(4));
    VectorNode *v = new VectorNode(new Token(Token::VEC), elements);
    VarNode *xref = new VarNode(new Token(Token::ID, "x"));
    ExprNode *pv = new MultNode(xref, mult, v);
    PrintNode *p = new PrintNode(new Token(Token::PRINT, "print"), pv);
    stats.push_back(p);
    StatListNode *statlist = new StatListNode(stats);
    statlist->print();
    system("pause");
    return 0;
}
